//
//  LXMyGroupViewController.m
//  LvXi_newVersion
//
//  Created by 诸葛孔明 on 16/8/16.
//  Copyright © 2016年 SJT. All rights reserved.
//............................................................................................//
//...........................................我的团队页面...........................................//
//............................................................................................//
#import "LXMyGroupViewController.h"
#import "LXMyGroupViewCell.h"
#import "LXMySecondGroupViewController.h"

static NSString *const LXMyGroupViewCellID = @"LXMyGroupViewCell";

@interface LXMyGroupViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,weak) UITableView *tableView;

@end

@implementation LXMyGroupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"我的团队";
    
    [self setUpTableView];
}

- (void)viewWillAppear:(BOOL)animated
{
    
    self.navigationController.navigationBar.hidden = NO;
}

#pragma mark - tableview初始化
- (void)setUpTableView
{
    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight) style:UITableViewStyleGrouped];
    tableView.contentInset = UIEdgeInsetsMake(10, 0, 40, 0);
    tableView.rowHeight = MineRatio(60);
    tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    tableView.delegate = self;
    tableView.dataSource = self;
    [self.view addSubview:tableView];
    self.tableView = tableView;
    
    [self.tableView registerClass:[LXMyGroupViewCell class] forCellReuseIdentifier:LXMyGroupViewCellID];
}

#pragma mark - TableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *myGroupCell = [tableView dequeueReusableCellWithIdentifier:LXMyGroupViewCellID];
    myGroupCell.textLabel.text = @"善觉堂";
    myGroupCell.imageView.image = [UIImage imageWithMargin:0.1 marginColor:[UIColor whiteColor] image:[UIImage imageNamed:@"testImg1"]];
    myGroupCell.detailTextLabel.text = @"粉丝120人";
    
    return myGroupCell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.1;
}

#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    LXMySecondGroupViewController *secondGroupVc = [[LXMySecondGroupViewController alloc] init];
    [self.navigationController pushViewController:secondGroupVc animated:YES];

}

@end
